package com.edu.data;

public class ShoppingCartItem {
    private Product product;
    private long quantity;
    private float cost;

    public ShoppingCartItem(Product product, long quantity) {
        this.product = product;
        this.quantity = quantity;
        this.cost = (float) (product.getEpPrice() * quantity);
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public long getQuantity() {
        return quantity;
    }

    public void setQuantity(long quantity) {
        this.quantity = quantity;
        this.cost = (float) (product.getEpPrice() * quantity);
    }

    public float getCost() {
        return cost;
    }

    public void setCost(float cost) {
        this.cost = cost;
    }
}
